<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="author" content="zhaozhenguo">
	<title>选择卡片类型名称</title>
	<script language="javascript" src="../script/common.js" type="text/javascript"></script>
	<script language="javascript" type="text/javascript">
	var qt = {};								//数据表格对象
	function load(){
		setPages(["listview","amply"]);
		var defCode = getPara("defBaseCardType");			//默认的基本卡片类型
		if(defCode){
			var anonymous = getPara("anonymous");
			if(anonymous){
				searchForm.anonymous.value = false;
			}
			var userLevel = getPara("userLevel");
			if(userLevel){
				searchForm.userLevel.value = userLevel;
			}
			var list = Common.getSubsetItems("base_card_type", [BaseCardType.PERSONAL,BaseCardType.COMPANY]);
			 	
			Common.initDict("baseCardType",list)
			if (defCode){
				searchForm.baseCardType.value = defCode
				searchForm.baseCardType.disabled = true;
			}else
				searchForm.baseCardType.value = BaseCardType.PERSONAL
				
		}else{
			Common.initDict(searchForm.baseCardType,"base_card_type","全部");
		}
		createTable();
	}
	function createTable(){
	  	var columns = [];
			columns[0]= {type:"radio"};
			columns[1]= {render:nameFunc};	
		qt = new QueryTable("card_type_manager_query","searchForm","datalist",columns,{showData:true,columnsConf:false});
	}
	//类型名称的超链接
	function nameFunc(v,r){
		return "<a href=# onclick=lookCardType("+r[0]+","+r[5]+")>"+v+"</a>"
	}
	//点击进入类型名称明细信息的方法
	function lookCardType(id,baseType){
		var v = openDialogFrame("/basic/card_type_list_sub.html?cardTypeId="+id+"&baseType="+baseType,'卡片类型明细信息',400,650);
	}
	//显示数据
	function showData(){	
		qt.showTable();				
	}
	function onSave() {
		var obj = qt.getRadioValue(true);
		if(obj==null){
			showWarning("请选择一种类型名称");return;
		}
		dialogBackValue(obj);
	}


	</script>
</head>
	
<body onload="load()">
	<div id="listview">
		<div class="searchForm">
			<form id="searchForm" name="searchForm">
				<input type="hidden" name="anonymous">
				<input type="hidden" name="userLevel">
				<table cellSpacing=0 cellPadding=6 width="100%" border=0>
					<tr>
						<td><label>类型名称</label> <input type="text" name="name"></td>
						<td><label>基本卡类型</label> <select name="baseCardType"><option></option></select></td>
						<td><button type="button" onclick="showData()">查   询</button></td>
					</tr>
				</table>
			</form>
		</div>	
		<div id="datalist"></div>
	</div>		
</body>
</html>